package com.yupi.yurpc.registry;

import com.yupi.yurpc.spi.SpiLoader;
/*
注册工厂类
 */
public class RegistryFactory {

    static {
        SpiLoader.load(Registry.class);
    }
    /**
     *
     默认注册中心
     */
    private static final Registry DEFAULT_REGISTRY = new EtcdRegistry();
    /**
     *
     获取实例
     *
     * @param key
     * @return
     */
    public static Registry getInstance(String key) {
        return SpiLoader.getInstance(Registry.class, key);
    }
}
